package com.ec.api.client;

import com.ec.api.config.FeignConfig;
import com.ec.api.domain.po.MedicineRecord;
import com.ec.common.domain.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;
import java.util.List;

@FeignClient(value = "care-service", configuration = FeignConfig.class)
public interface MedicineRecordClient {
    
    /**
     * 根据用户ID和时间范围获取用药记录
     */
    @GetMapping("/medicine/records/by-user")
    Result<List<MedicineRecord>> getMedicineRecordsByUserId(
            @RequestParam("userId") Long userId,
            @RequestParam("startDate") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate,
            @RequestParam("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate);
}